import java.util.List;

public class Transacao {
	private int id;
	private long timestamp;
	private List<Operacao> operacaoList;
	private int first;
	
	public Operacao getFirst() {
		first++;
		
		if (first < operacaoList.size())
			return operacaoList.get(first);
		else
			return null;
	}
	
	public void restart() {
		first = -1;
	}
	
	public Transacao(int id) {
		this.id = id;
		first = -1;
	}

	public int getId() {
		return id;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public List<Operacao> getOperacaoList() {
		return operacaoList;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public void setOperacaoList(List<Operacao> operacaoList) {
		this.operacaoList = operacaoList;
	}

	@Override
	public String toString() {
		return "Transacao [id=" + id + ", timestamp=" + timestamp
				+ ", operacaoList=" + operacaoList + "]";
	}
}